import axios from "axios";
import qs from "querystring";

// axios 配置
axios.defaults.timeout = 6000;
axios.defaults.baseURL = "";
axios.defaults.headers["Content-Type"] =
  "application/x-www-form-urlencoded; charset=UTF-8";

// http request 拦截器
axios.interceptors.request.use(async (config = {}) => {
    return config;
  },
  (error) => {
    return Promise.reject(error);
  }
);

// http response 拦截器
axios.interceptors.response.use(async (res) => {
    return res;
  },
  (error) => {
    return Promise.reject(error);
  }
);

export default axios;
